import $axios, { Result } from '@/plugins/axios'
import { AxiosResponse } from 'axios'
import { PageParam } from '@/type'

/**
 * 分页查询单位下所有事项
 * @param pageParam
 */
export async function getUnitMatterByPage(
  pageParam: PageParam,
): Promise<AxiosResponse<Result>> {
  return await $axios.post(
    '/supervision-api/matter/getUnitMatterByPage',
    pageParam,
  )
}

/**
 * 主动办结
 * @param matterId 事项id
 */
export async function matterDone(
  matterId: number,
): Promise<AxiosResponse<Result>> {
  return await $axios.get('/supervision-api/matter/matterDone', {
    params: {
      matterId,
    },
  })
}
